<?php if (!defined('SERVER_ROOT')) exit('No direct script access allowed');

class bckh_Controller extends Controller {

    function __construct()
    {
        parent::__construct('giangvien', 'bckh');
        $this->check_login();
        $this->view->template->menu_html =$this->CREATE_MENU();
        $this->view->template->nhacviec_html =$this->CREATE_NHAC_VIEC(); 
        $this->CHECK_QUYEN('giangvien', 'bckh');
    }

    function main(){
        $this->dsp_all_bckh();
    }

    function dsp_all_bckh(){
        $VIEW_DATA['arr_all_bckh']= $this->model->qry_all_bckh();
        $this->view->render('dsp_all_bckh', $VIEW_DATA);
    }
    public function dsp_single_bckh($TEN_BCKH){
        $TEN_BCKH = replace_bad_char($TEN_BCKH);
        $VIEW_DATA['arr_all_loaibckh'] = $this->model->SELECT_LOAIBCKH_nothing();
        $VIEW_DATA['arr_single_bckh'] = $this->model->qry_single_bckh($TEN_BCKH);
        $this->view->render('dsp_single_bckh', $VIEW_DATA);
    }
    public function update_bckh()
    {
        $this->model->goback_url = $this->view->get_controller_url() . 'dsp_all_bckh';
        $this->model->update_bckh();
    }
    public function delete_bckh(){
        $this->model->goback_url = $this->view->get_controller_url() . 'dsp_all_bckh';
        $this->model->delete_bckh();
    }
}